# coding:utf-8
__author__ = 'jarvis'

from flask import Flask
import sys

reload(sys)
sys.setdefaultencoding('utf-8')


def create_app():
    app = Flask(__name__)
    with app.test_request_context():
        from models import User
    # 注册蓝图
    from app.views import Index, User, Wechat
    # 微信消息处理
    app.register_blueprint(Wechat.mod)
    app.register_blueprint(User.mod, url_prefix='/user')
    return app
